#!/bin/bash

# https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.3.1/deploy/static/provider/baremetal/deploy.yaml
# edit deploy.yaml delete @sha256 .....
# run it on all nodes

mkdir -p /usr/local/certificates/

ingress=v1.3.1

webhookcertgen=anjia0532/google-containers.ingress-nginx.kube-webhook-certgen:v1.3.0

url=anjia0532/google-containers.ingress-nginx.controller

# download ingress-nginx image
nerdctl -n k8s.io pull $url:$ingress
nerdctl -n k8s.io tag $url:$ingress registry.k8s.io/ingress-nginx/controller:$ingress
nerdctl -n k8s.io rmi -f $url:$ingress

# download webhookcertgen 
nerdctl -n k8s.io pull $webhookcertgen
nerdctl -n k8s.io tag $webhookcertgen registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.3.0
nerdctl -n k8s.io rmi -f $webhookcertgen

